********************************************************************************
********************************************************************************
* Title: 		preamble
* Project:		Stress, Ethnicity, and Prosocial Behavior
* Author:		Moritz Poll (moritz.poll@brown.edu)
* PIs:			Johannes Haushofer, Sara Lowes, Abednego Musau, David Ndetei, 
*				Nathan Nunn, Moritz Poll, Nancy Qian
* Purpose:		Master File Preamble
********************************************************************************
********************************************************************************

********************************************************************************
*********************************** Preamble ***********************************
********************************************************************************
{
label drop _all
clear all
set varabbrev on
set more off
set trace off
pause on
cls
graph set window fontface "CMU Serif"
set matsize 800 // Stata 14.2
capture set matsize 10000 // Stata SE 14.2
}
********************************************************************************
******************************** Set Directory *********************************
********************************************************************************
{
global rawdata_dir			"$root_dir/Data/rawdata"
global cleandata_dir		"$root_dir/Data/cleandata"
global outputdata_dir		"$root_dir/Data/outputdata"
global estimates_dir		"$root_dir/Data/estimates"
global repdata_dir			"$root_dir/stress_replication/data"
global do_analysis_dir		"$root_dir/Analysis/dofiles/analysis"
global do_cleaning_dir		"$root_dir/Analysis/dofiles/cleaning"
global do_building_hfc_dir	"$root_dir/Analysis/dofiles/building_hfc"
global do_payouts_dir		"$root_dir/Analysis/dofiles/payouts"
global do_unblind_dir		"$root_dir/Analysis/dofiles/unblinding"
global tables_dir			"$root_dir/Deliverables/tables"
global figures_dir			"$root_dir/Deliverables/figures"
global notes_dir			"$root_dir/Deliverables/Manuscript/_notes"
global payouts_dir			"$root_dir/Admin/Session Organization/Payouts"
global treatassign_dir		"$root_dir/Admin/Session Organization/Barcoding/treatment assign"
global barcodes_dir			"$root_dir/Admin/Session Organization/Barcoding/barcodes"
global timesheet_dir		"$root_dir/Admin/Session Organization/Timesheet/Sessions"
sysdir set PERSONAL 		"$root_dir/Analysis/ado" // Tells Stata where to find ado files added by us

cd "$root_dir"
}
********************************************************************************
********************************* Definitions **********************************
********************************************************************************

** Variable Lables
global main_table_vars cyd dg tg1 tg2 social_proximity
global controls		_luo _kikuyu _luhya _female _middleaged _old luo kikuyu luhya female middleaged
global cyd_controls _luo _kikuyu _luhya _female _middleaged _old
global dg_name						"Dictator Game"
global cyd_name						"Choose Your Dictator"
global cydA_name					"Choose Your Dictator (Person A)"
global cydB_name					"Choose Your Dictator (Person B)"
global tg1_name						"Trust Game - Stage 1"
global tg2_name						"Trust Game - Stage 2"
global exit_name					"Exit Survey Vignettes"
global social_proximity_name		"Social Proximity Survey"
global demand_name					"Experimenter Demand Module"
global dg_shortname					"DG"
global cyd_shortname				"CYD"
global cydA_shortname				"CYD A"
global cydB_shortname				"CYD B"
global tg1_shortname				"TG1"
global tg2_shortname				"TG2"
global exit_shortname				"Exit Survey"
global social_proximity_shortname	"Social Proximity"
global demand_shortname				"Demand"

** Graphs & Tables
global precision = 4 // Number of digits behind the comma shown in tables
global table_design	"b($precision) se label booktabs star(* 0.1 ** 0.05 *** 0.01) order(_cons) replace"
global bar_design 	`"graphregion(color(white))"'
global hist_design 	"percent scale(1.2) graphregion(color(white) margin(0 0 0 0)) color(edkblue) lcolor(white)"
global line_design 	`"ylabel(, nogrid) yline(0, lcolor(gray)) legend(order(1 "Coethnic Bias:" "Placebo" 2 "Coethnic bias:" "Hydrocortisone" 3 "Difference in" "coethnic bias") symxsize(6) rows(1) region(color(white))) graphregion(color(white))"'
global guess_design `"stack percentage bar(1, color(green)) bar(2, color(maroon)) graphregion(color(white)) legend(label(1 "Correct") label(2 "Incorrect")) ytitle("Percent")"'

** Colors
global colorDEP "ebblue"
global colorSEP "edkblue"
global colorDEH "cranberry"
global colorSEH "maroon"
